package com.example.holamundo2;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainActivity extends Activity {
	private Button bAcercaDe;
	private Button bSalir;

	private String s = "hola";
	private int i = 5;
	
    @Override
    protected void onCreate(Bundle savedInstanceState) {
    	//Log.d("HolaMundo","Entramos en onCreate");
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        bAcercaDe =(Button) findViewById(R.id.button1);

        bAcercaDe.setOnClickListener(new OnClickListener() {
                   public void onClick(View view) {
                        lanzarAcercaDe(null);
                  }
            });
        bSalir = (Button) findViewById(R.id.button2);
        
        bSalir.setOnClickListener(new OnClickListener(){
        		public void onClick(View view) {
        			lanzarSalir(null);
        		}
        });
        
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }
    
    public void lanzarAcercaDe(View view){
        Intent i = new Intent(this, AcercaDe.class);
              startActivity(i);
      }
    
    public void lanzarSalir(View view){
        finish();	
      }
}
